package com.sj.uabrowser.mvp.main.view.adp;

import android.graphics.Color;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sj.uabrowser.R;
import com.sj.uabrowser.net.bean.Oper;

import java.util.List;


public class OperAdp extends BaseQuickAdapter<Oper, BaseViewHolder> {

    public OperAdp(int layoutResId, @Nullable List<Oper> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, Oper item) {
//        helper.setImageResource(R.id.iv_func,item.getResId());
//        if (TextUtils.equals(item.getTitle(), "工具箱")) {
//            ((TextView) helper.getView(R.id.tv_title)).setTextColor(Color.GRAY);
//        } else
//            if (TextUtils.equals(item.getTitle(), "多窗口")) {
//            helper.getView(R.id.iv_func).setVisibility(View.INVISIBLE);
//            helper.getView(R.id.tv_multi_window).setVisibility(View.VISIBLE);
//            helper.setText(R.id.tv_multi_window, TApplication.getInstance().getFuncActs().size() + "");
//            ((TextView) helper.getView(R.id.tv_title)).setTextColor(Color.GRAY);
//        }
        helper.setImageResource(R.id.iv_func,item.getResId());
//        Glide.with(mContext)
//                .load(item.getResId())
//                .into((ImageView) helper.getView(R.id.iv_func));
        helper.setText(R.id.tv_title, item.getTitle());
    }
}
